#include <iostream>
using namespace std;

void mkheap(int a[], int n);
void adjust_down(int a[], int beg, int lim);
void heap_sort(int a[], int n);
void print(int a[], int n);
inline void swap(int &a, int &b) { int tmp = a; a = b; b = tmp; }
